package main

import "fmt"

func fun1(a string, b int) int {
	fmt.Println("a=", a)
	fmt.Println("b=", b)

	c := 100
	return c
}

//返回多个参数，匿名的

func fun2(a string, b int) (int, int) {
	fmt.Println("a=", a)
	fmt.Println("b=", b)

	c := 100
	return c, b
}

// 返回多个返回值，有形参名称的
func fun3(a string, b int) (r1 int, r2 int) {
	fmt.Println("a=", a)
	fmt.Println("b=", b)
	//给有名称的返回值变量赋值
	r1 = 100
	r2 = b
	return
}
func main() {
	c := fun1("a", 10)
	fmt.Println("c=", c)

	ret1, ret2 := fun2("a", 10)
	fmt.Println("ret1=", ret1, "ret2=", ret2)

	r1, r2 := fun3("a", 10)
	fmt.Println("r1=", r1, "r2=", r2)

}
